<template>
	<view class="article">
		<!-- <view class="article-title">牛初乳</view>	 -->
		<!-- 大图 -->
		<view class="article-bg">
			<image :src="info.src" mode="widthFix"></image>
		</view>
		<view class="sect-title mt15">
			<view class="pro-title">{{ info.title }}</view>
			<view class="parag">{{ info.subTitle }}</view>
		</view>
		<view class="sect-detail">
			<!-- <view class="mt15">--图文详情--</view> -->
			<!-- <view class="ad product-imgs">
                <view class="imgs">
                    <image src="/static/ys_bg.png" mode="widthFix"></image>
                    <image src="/static/ys_bg2.png" mode="widthFix"></image>
                    <image src="/static/ys_bg3.png" mode="widthFix"></image>
                    <image src="/static/pro1_bg1.png" mode="widthFix"></image>
                    <image src="/static/pro1_bg2.png" mode="widthFix"></image>
                    <image src="/static/pro2_bg1.png" mode="widthFix"></image>
                    <image src="/static/pro2_bg2.png" mode="widthFix"></image>
                </view>
            </view> -->
			<rich-text :nodes="info.detail"></rich-text>
		</view>
		<!--        <view class="to-ad mt15">生命阳光牛初乳，你的首先免疫营养品</view> -->
	</view>
</template>

<script>
import myServer from '@/plugins/http/server/my';
import parseHtml from '@/assets/js/html-parser';
export default {
    data() {
        return {
            'info': {}
        };
    },
    onLoad(event) {
        this.getData(event.id);
    },
    'methods': {
        getData(id) {
            myServer
                .miniProductInfo({ id })
                .then(({ data }) => {
                    data.detail = parseHtml(data.detail);
                    this.info = data;
                    // 标题
                    uni.setNavigationBarTitle({
                        'title': data.title
                    });
                })
                .catch(e => {
                    console.log(e);
                });
        }
    }
};
</script>

<style lang="less" scoped>
	@import 'index.less';
</style>
